Carbon


SetControlData

Header: Controls.h Carbon status: Supported

Sets control-specific data.

OSErr SetControlData (
    ControlRef inControl, 
    ControlPartCode inPart, 
    ResType inTagName, 
    Size inSize, 
    void *inData
);
inControl

A handle to the control for which data is to be set.

inPart

The part code of the control part for which data is to be set; see “Meta Control Part Code Constants”, “Control Part Code Constants”, and “Control State Part Code Constants”. Passing kControlEntireControl indicates that either the control has no parts or the data is not tied to any specific part of the control.

inTagName

A constant representing the control-specific data you wish to set; see the data tag constants in the “Control Manager Constants” section.

inSize

The size (in bytes) of the data pointed to by the inData parameter. For variable-length control data, pass the value returned in the outMaxSize parameter of GetControlDataSize in the inSize parameter. The number of bytes must match the actual data size.

inData

A pointer to a buffer allocated by your application. This buffer contains the data that you are sending to the control. After calling SetControlData, your application is responsible for disposing of this buffer, if necessary, as information is copied by control.

function result

A result code. The result code errDataNotSupported indicates that the inTagName parameter is not valid.

DISCUSSION

The SetControlData function sets control-specific data represented by the value in the inTagName parameter to the data pointed to by the inData parameter. SetControlData could be used, for example, to switch a progress indicator from a determinate to indeterminate state. For a list of the control attributes that can be set, see the data tag constants in the “Control Manager Constants” section.

VERSION NOTES

This function is available with Appearance Manager 1.0 and later.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)